import React from 'react'
import SideMenu from '../../components/SideMenu'
import TopHeader from '../../components/TopHeader';
import { Layout,Spin} from 'antd';
import {Outlet } from 'react-router-dom';
import './index.css'
import {connect} from 'react-redux'
const { Content} = Layout;

function NewsSandBox(props) {
  
  // const [BackRouteList,setBackRouteList]=useState([])
  // useEffect(()=>{
  //   Promise.all([
  //     axios.get("http://localhost:8000/rights"),
  //     axios.get("http://localhost:8000/children")
  //   ]).then(res=>{
  //     setBackRouteList([...res[0].data,...res[1].data])
  //     console.log([...res[0].data,...res[1].data]);
  //   })
   
  // },[])

  return (
    <Layout >
      <SideMenu style={{height:'110%'}}></SideMenu>
      <Layout className="site-layout" style={{height:"120%"}}>
      <TopHeader></TopHeader>
      <Content
          className="site-layout-background"
          style={{
            margin: '24px 16px',
            padding: 24,
            minHeight: 280,
          }}
        >
           <Spin spinning={props.isLoading}> <Outlet></Outlet></Spin>
      </Content>
      </Layout>
      
    </Layout>
  )
}
const mapStateToProps=({LoadingReducer:{isLoading}})=>(
  {
    isLoading
    }
)
export default connect(mapStateToProps)(NewsSandBox)